package com.erp.erp_servers.money.imp;

import com.erp.erp_dao.money.IReceivePaymentSplitDao;
import com.erp.erp_entitys.money.entity.ReceivePaymentSplitEntity;
import com.erp.erp_servers.money.IReceivePaymentSplitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : ReceivePaymentSplitServiceImp
 * @Description : 资金管理-收款-拆分实现类
 * @Author : lst
 * @Date: 2020-12-15 20:13
 */
@Service
public class ReceivePaymentSplitServiceImp implements IReceivePaymentSplitService {

    /**
     * 注入拆分表mapper
     */
    private final IReceivePaymentSplitDao receivePaymentSplitDao;

    @Autowired
    public ReceivePaymentSplitServiceImp(IReceivePaymentSplitDao receivePaymentSplitDao) {
        this.receivePaymentSplitDao = receivePaymentSplitDao;
    }


    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public ReceivePaymentSplitEntity queryById(Integer id) {
        return receivePaymentSplitDao.queryById(id);
    }


    /**
     * 通过实体作为筛选条件查询
     *
     * @param receivePaymentSplit 实例对象
     * @return 对象列表
     */
    @Override
    public List<ReceivePaymentSplitEntity> queryAll(ReceivePaymentSplitEntity receivePaymentSplit) {
        return receivePaymentSplitDao.queryAll(receivePaymentSplit);
    }


    /**
     * 新增数据
     *
     * @param receivePaymentSplit 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(ReceivePaymentSplitEntity receivePaymentSplit) {
        return receivePaymentSplitDao.insert(receivePaymentSplit);
    }


    /**
     * 修改数据
     *
     * @param receivePaymentSplit 实例对象
     * @return 影响行数
     */
    @Override
    public int update(ReceivePaymentSplitEntity receivePaymentSplit) {
        return receivePaymentSplitDao.update(receivePaymentSplit);
    }


    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<ReceivePaymentSplitEntity> list) {
        return receivePaymentSplitDao.addList(list);
    }
}
